<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 拍卖预展时间 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\AuctionAdvanceShow.name", default="fa_auction_advance_show"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\AuctionAdvanceShow.poolName"))
 * @DDL(sql="CREATE TABLE `fa_auction_advance_show` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `num` int(10) unsigned DEFAULT NULL COMMENT '时长',
  `status` enum('s','i','h','d','m','y') DEFAULT NULL COMMENT '状态:s=秒,i=分,h=小时,d=天,m=月,y=年',
  `s` int(10) DEFAULT NULL COMMENT '秒',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='拍卖预展时间'", decode="")
 *
 * @property int|null $id 
 * @property string|null $name 
 * @property int|null $num 时长
 * @property string|null $status 状态:s=秒,i=分,h=小时,d=天,m=月,y=年
 * @property int|null $s 秒
 */
abstract class AuctionAdvanceShowBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * name.
     * @Column(name="name", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $name = NULL;

    /**
     * 获取 name.
     *
     * @return string|null
     */
    public function getName(): ?string
    {
        return $this->name;
    }

    /**
     * 赋值 name.
     * @param string|null $name name
     * @return static
     */
    public function setName($name)
    {
        $this->name = null === $name ? null : (string)$name;
        return $this;
    }

    /**
     * 时长.
     * num
     * @Column(name="num", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $num = NULL;

    /**
     * 获取 num - 时长.
     *
     * @return int|null
     */
    public function getNum(): ?int
    {
        return $this->num;
    }

    /**
     * 赋值 num - 时长.
     * @param int|null $num num
     * @return static
     */
    public function setNum($num)
    {
        $this->num = null === $num ? null : (int)$num;
        return $this;
    }

    /**
     * 状态:s=秒,i=分,h=小时,d=天,m=月,y=年.
     * status
     * @Column(name="status", type="enum", length=0, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $status = NULL;

    /**
     * 获取 status - 状态:s=秒,i=分,h=小时,d=天,m=月,y=年.
     *
     * @return string|null
     */
    public function getStatus(): ?string
    {
        return $this->status;
    }

    /**
     * 赋值 status - 状态:s=秒,i=分,h=小时,d=天,m=月,y=年.
     * @param string|null $status status
     * @return static
     */
    public function setStatus($status)
    {
        $this->status = null === $status ? null : (string)$status;
        return $this;
    }

    /**
     * 秒.
     * s
     * @Column(name="s", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $s = NULL;

    /**
     * 获取 s - 秒.
     *
     * @return int|null
     */
    public function getS(): ?int
    {
        return $this->s;
    }

    /**
     * 赋值 s - 秒.
     * @param int|null $s s
     * @return static
     */
    public function setS($s)
    {
        $this->s = null === $s ? null : (int)$s;
        return $this;
    }

}
